<!--
 * @Author: lmk
 * @Date: 2021-09-10 09:58:31
 * @LastEditTime: 2021-11-22 20:45:24
 * @LastEditors: lmk
 * @Description: 
-->
<template>
	<view :class="currentTheme">
		<a-nabbar name="正在游戏中" />
		<view class="u-padding-left-32 u-padding-right-32">
			<view v-for="(item, index) in dataList" :key="index" style="position: relative;" class="u-margin-top-20" @click="carTime(item)">
				<list-item :item="item" :isAvatar="false" :showStar="false" :showFooterRight="false" :isShare="false" height="400">
					<view slot="content">
						<view class="text-color-9598a4 u-font-26 u-margin-top-20 ">开始游戏时间 : {{ item.estimateTime }}</view>
						<view class="text-color-9598a4 u-row-bottom u-font-26 u-margin-top-20 u-margin-bottom-80 address">剧本简介: {{ item.info || '暂无' }}</view>

						<view class="u-flex xiam xiams">
							<item-image :type="'1'" :img="item.avatar" :size="42" class="u-margin-right-8" :fade="false" />
							<text class="text-bold u-font-28 box-title">{{ item.createName || '' }}</text>
						</view>
						<view class="u-flex u-row-right xiam">
							<view class="u-font-28 text-color-765CFE u-margin-right-20">{{ item.participate }}/{{ item.people }}人</view>
							<text @click="carTime(item)" class="u-font-24">游戏中</text>
						</view>
					</view>
				</list-item>
			</view>
		</view>
	</view>
</template>

<script>
import { getDetail } from '@/api/crud.js';
import itemBtn from '../../components/item-btn/item-btn.vue';
export default {
	components: { itemBtn },
	data() {
		return {
			dataList: [],
			apiModule: 'shopApi'
		};
	},
	onLoad() {
		this.getList();
	},
	onShow() {
		this.getList();
	},
	methods: {
		getList() {
			getDetail({}, 'gatherGame', this.apiModule, `findRunningByStore/${this.loginForm.uid}`).then(res => {
				this.dataList = res;
			});
		},
		goPathDetail(item) {
			this.$u.route({
				url: '/pagesA/storeAddLarp/detail',
				params: {
					id: item.id
				}
			});
		},
		//跳转到倒计时页面
		carTime(item) {
			if (item.dmUid == this.loginForm.uid) {
				this.$u.route({
					url: '/pagesA/carTime/gameTime',
					params: {
						id: item.id
					}
				});
			} else {
				this.goPathDetail(item);
			}
		}
	}
};
</script>

<style lang="scss">
.xiam {
	position: absolute;
	bottom: 0rpx;
	right: 0rpx;
}

.xiams {
	bottom: 40rpx;
	left: 230rpx;
}
</style>
